package cn.ycc1.boot3ftp.controller;

import cn.ycc1.boot3ftp.service.FtpService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @author ycc
 * @date 2023/11/26
 */
@Slf4j
@RestController
public class TestController {
    @Autowired
    private FtpService ftpService;

    @GetMapping("/test")
    public String test() throws IOException {

        String filePath = "C:\\home\\test\\output3.zip"; // 本地文件路径
        ftpService.uploadFile(filePath); // 上传文件到FTP服务器
        return "hello test4";
    }
}
